From a826ee37caf12a21af257ba4a23f0f3dbc4be7e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sun, 18 Jun 2017 12:29:59 +0200 Subject: [PATCH] widget: Remove _set_simple_clip Unused. --- gtk/gtkwidget.c | 61 ------------------------------------------ gtk/gtkwidgetprivate.h | 2 -- 2 files changed, 63 deletions(-) diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 46e2e67ecf..7474766750 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -13413,67 +13413,6 @@ gtk_widget_set_clip (GtkWidget *widget, gdk_rectangle_union (&allocation, &new_clip, &priv->clip); } -/* - * _gtk_widget_set_simple_clip: - * @widget: a #GtkWidget - * @content_clip: (nullable): Clipping area of the contents - * or %NULL, if the contents - * do not extent the allocation. - * - * This is a convenience function for gtk_widget_set_clip(), if you - * just want to set the clip for @widget based on its allocation, - * CSS properties and - if the widget is a #GtkContainer - its - * children. All children must have been allocated with - * gtk_widget_size_allocate() before calling this function. - * It is therefore a good idea to call this function last in - * your implementation of GtkWidget::size_allocate(). - * - * If your widget overdraws its contents, you cannot use this - * function and must call gtk_widget_set_clip() yourself. - **/ -void -_gtk_widget_set_simple_clip (GtkWidget *widget, - GtkAllocation *content_clip) -{ - GtkStyleContext *context; - GtkAllocation clip, allocation; - GtkBorder extents; - - context = _gtk_widget_get_style_context (widget); - - _gtk_widget_get_allocation (widget, &allocation); - - _gtk_css_shadows_value_get_extents (_gtk_style_context_peek_property (context, - GTK_CSS_PROPERTY_BOX_SHADOW), - &extents); - - clip = allocation; - clip.x -= extents.left; - clip.y -= extents.top; - clip.width += extents.left + extents.right; - clip.height += extents.top + extents.bottom; - - if (content_clip) - gdk_rectangle_union (content_clip, &clip, &clip); - - if (GTK_IS_CONTAINER (widget)) - { - GdkRectangle children_clip; - - gtk_container_get_children_clip (GTK_CONTAINER (widget), &children_clip); - - if (_gtk_widget_get_has_window (widget)) - { - children_clip.x += allocation.x; - children_clip.y += allocation.y; - } - - gdk_rectangle_union (&children_clip, &clip, &clip); - } - - gtk_widget_set_clip (widget, &clip); -} - /** * gtk_widget_get_allocated_size: * @widget: a #GtkWidget diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 18f7dc4a73..863405f489 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -242,8 +242,6 @@ void _gtk_widget_buildable_finish_accelerator (GtkWidget *widget, GtkWidget *toplevel, gpointer user_data); GtkStyleContext * _gtk_widget_peek_style_context (GtkWidget *widget); -void _gtk_widget_set_simple_clip (GtkWidget *widget, - GtkAllocation *content_clip); typedef gboolean (*GtkCapturedEventHandler) (GtkWidget *widget, GdkEvent *event); -- 2.30.2